//
//  BaseViewController.m
//  austore
//
//  Created by mac on 14-1-18.
//  Copyright (c) 2014年 mac. All rights reserved.
//

#import "BaseViewController.h"
#import "LPCAppMacro.h"

@interface BaseViewController ()
{
}

@end

@implementation BaseViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self)
    {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self adaptIos7];
}

- (void)adaptIos7
{
    if (IOS_VERSION >= 7.0f)
    {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.automaticallyAdjustsScrollViewInsets = NO;
#endif // #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)closeKeyborad:(id)sender
{
    if ([sender respondsToSelector:@selector(resignFirstResponder)])
    {
        [sender resignFirstResponder];
    }
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}

@end
